﻿<%@ Page Title="" Language="C#" MasterPageFile="~/User/User.Master"  AutoEventWireup="true" CodeBehind="YSKZD_Query.aspx.cs" Inherits="CoolERP_Web.User.YSKZD_Query" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="../Scripts/lhgdialog/lhgcore.min.js" type="text/javascript"></script>
<script src="../Scripts/lhgdialog/lhgdialog.js" type="text/javascript"></script>
<script type="text/javascript">
    function selGoods(id) {
        var dg = new J.dialog({ id: 'select', title: '查看合同明细', page: 'XSHTMX.aspx?id=' + id, iconTitle: false, cover: true, btnBar: false, rang: true, autoSize: true, width: 900, height: 650 });
        dg.ShowDialog();
    }
    function tansferXSHT(id, bh, khjc) {
        var dg = new J.dialog({ id: 'select', title: '销售合同转换生成应收款帐单', page: 'YSKZD_TO_SKD.aspx?id=' + id+'&bh='+bh+'&khjc='+khjc, iconTitle: false, cover: true, btnBar: false, rang: true, autoSize: true, width: 900, height: 650 });
        dg.ShowDialog();
    }
    function checkSKD(id) {
        var dg = new J.dialog({ id: 'select', title: '查看应收款帐单收款单', page: 'YSKZD_SKD.aspx?id=' + id, iconTitle: false, cover: true, btnBar: false, rang: true, autoSize: true, width: 900, height: 650 });
        dg.ShowDialog();
    } 
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td class=tbHead_L></td>
        <td class=tbHead_M><div><b>应收款帐单管理</b></div></td>
        <td class=tbHead_R></td>
    </tr>
    <tr>
        <td class=tbBody_L></td>
        <td class=tbBody_M>
            <ul class=tags style="width:95%;">
                <li class=liTitle><div>查询条件</div></li>
            </ul>
            <table class="grvCSS" cellspacing="0" cellpadding=2 border="1" style="width:95%;border-collapse:collapse;">
                <tr>
                    <td align=right>帐单编号：</td>
                    <td style="text-align:left;"><asp:TextBox ID="tbBH" runat="server" CssClass="textbox" MaxLength="64"></asp:TextBox></td>
                    <td align=right>客户简称：</td>
                    <td style="text-align:left;"><asp:TextBox ID="tbKHJC" runat="server" CssClass="textbox" MaxLength="64"></asp:TextBox></td>                                              
                    <td align=right>操作人员:</td>
                    <td style="text-align:left;"><asp:TextBox ID="tbCZRYName" runat="server" CssClass="textbox" MaxLength="64"></asp:TextBox></td>                                              
                    <td><asp:ImageButton ID="btnQuery" runat="server" ImageUrl="~/Images/Common/btn_query0.png" onclick="btnQuery_Click" /></td>
                </tr>
                <tr>
                    <td align=right>创建时间:</td>
                    <td style="text-align:left;"><asp:TextBox ID="tbCJSJ" runat="server" CssClass="textbox Wdate" Width=85px onclick="WdatePicker({dateFmt: 'yyyy-MM-dd'});"/>
                    <td align=right>催款时间:</td>
                    <td style="text-align:left;"><asp:TextBox ID="tbCKSJ" runat="server" CssClass="textbox Wdate" Width=85px onclick="WdatePicker({dateFmt: 'yyyy-MM-dd'});"/>
                    <input type="hidden" runat=server id="hidStaff" /></td>
                    <td align=right>应收总额:</td>
                    <td style="text-align:left;"><asp:TextBox ID="tbYSZEMin" runat="server" CssClass="textbox" MaxLength="32"></asp:TextBox>                                            
                    ——<asp:TextBox ID="tbYSZEMax" runat="server" CssClass="textbox" MaxLength="32"></asp:TextBox></td>
                    <td><asp:ImageButton ID="btnReset" runat="server" ImageUrl="~/Images/Common/btn_reset0.png" OnClick="btnReset_Click" /></td>
                </tr>
            </table>
            <ul class=tags>
                <li class=liLeft><b>应收款帐单列表</b></li>
                <li onclick="selTag(this);"><div><asp:LinkButton ID="LinkButton1" Text="待转换销售合同" runat="server" CommandArgument="0" OnCommand="LinkButton_Command"/></div></li>
                <li class=selTag onclick="selTag(this);"><div><asp:LinkButton ID="LinkButton2" Text="未结算帐单" runat="server" CommandArgument="1" OnCommand="LinkButton_Command"/></div></li>
                <li onclick="selTag(this);"><div><asp:LinkButton ID="LinkButton3" Text="已结算帐单" runat="server" CommandArgument="2" OnCommand="LinkButton_Command"/></div></li>
            </ul>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>            
            <asp:GridView ID="GridView1" DataKeyNames="ID" Width=100% ClientIDMode=Static runat="server" CssClass="grvCSS" AutoGenerateColumns="False" AllowPaging="True"
                PageSize=20 OnSelectedIndexChanging="GridView1_SelectedIndexChanging" OnRowDataBound="GridView1_RowDataBound">
            <Columns>
                <asp:BoundField DataField="BH" HeaderText="合同编号"/>
                <asp:BoundField DataField="KHJC" HeaderText="客户简称"/>
                <asp:BoundField DataField="LXR" HeaderText="客户联系人"/>
                <asp:BoundField DataField="BMMC" HeaderText="销售部门"/>
                <asp:BoundField DataField="RYMC" HeaderText="销售员"/>
                <asp:BoundField DataField="DHSJ" HeaderText="订货时间"/>
                <asp:BoundField DataField="CHSJ" HeaderText="出货时间"/>
                <asp:BoundField DataField="CHFS" HeaderText="出货方式"/>
                <asp:TemplateField HeaderText="查看明细">
                    <ItemTemplate><input type=button value="明细" class=btn_s onclick="selGoods('<%#Eval("ID") %>')" /></ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作">
                    <ItemTemplate><input type=button value="转为应收帐单" class=btn_s onclick="tansferXSHT('<%#Eval("ID") %>','<%#Eval("BH") %>','<%#Eval("KHJC") %>')" /></ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerSettings Visible=false />
            </asp:GridView>
            <asp:GridView ID="GridView2" DataKeyNames="ID" Width=100% ClientIDMode=Static runat="server" CssClass="grvCSS" AutoGenerateColumns="False" AllowPaging="True"
                PageSize=20 OnSelectedIndexChanging="GridView2_SelectedIndexChanging" OnRowDataBound="GridView2_RowDataBound">
            <Columns>
                <asp:BoundField DataField="BH" HeaderText="帐单编号"/>
                <asp:BoundField DataField="KHJC" HeaderText="客户简称"/>
                <asp:BoundField DataField="XSHTBH" HeaderText="合同编号"/>
                <asp:BoundField DataField="CZRYName" HeaderText="操作人员"/>
                <asp:BoundField DataField="DHSJ" HeaderText="订货时间"/>
                <asp:BoundField DataField="CHSJ" HeaderText="出货时间"/>
                <asp:BoundField DataField="CJSJ" HeaderText="创建时间"/>
                <asp:TemplateField HeaderText="查看收款单">
                    <ItemTemplate><input type=button value="查看" class=btn_s onclick="checkSKD('<%#Eval("ID") %>')" /></ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerSettings Visible=false />
            </asp:GridView>
            <asp:GridView ID="GridView3" DataKeyNames="ID" Width=100% ClientIDMode=Static runat="server" CssClass="grvCSS" AutoGenerateColumns="False" AllowPaging="True"
                PageSize=20 OnSelectedIndexChanging="GridView2_SelectedIndexChanging" OnRowDataBound="GridView2_RowDataBound">
            <Columns>
                <asp:BoundField DataField="BH" HeaderText="帐单编号"/>
                <asp:BoundField DataField="KHJC" HeaderText="客户简称"/>
                <asp:BoundField DataField="XSHTBH" HeaderText="合同编号"/>
                <asp:BoundField DataField="CZRYName" HeaderText="操作人员"/>
                <asp:BoundField DataField="DHSJ" HeaderText="订货时间"/>
                <asp:BoundField DataField="CHSJ" HeaderText="出货时间"/>
                <asp:BoundField DataField="CJSJ" HeaderText="创建时间"/>
                <asp:TemplateField HeaderText="查看收款单">
                    <ItemTemplate><input type=button value="查看" class=btn_s onclick="checkSKD('<%#Eval("ID") %>')" /></ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerSettings Visible=false />
            </asp:GridView>
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CssClass="pager" UrlPaging="false" ShowCustomInfoSection="Left"
                FirstPageText="首页" LastPageText="尾页" PrevPageText="前页" NextPageText="后页" OnPageChanged="AspNetPager1_PageChanged" 
                TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" PageIndexBoxType="TextBox" ShowPageIndexBox="Always" 
                SubmitButtonText="Go" CustomInfoHTML="共%RecordCount%条数据，每页%PageSize%条，共%PageCount%页，当前为第%CurrentPageIndex%页">
            </webdiyer:AspNetPager>
            <asp:Panel ID="panMsg" runat="server" ClientIDMode=Static CssClass="msg24_attention" Visible=false>无相关数据</asp:Panel>
            </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="AspNetPager1" EventName="PageChanged" />
                    <asp:AsyncPostBackTrigger ControlID="LinkButton1" EventName="Command" />
                    <asp:AsyncPostBackTrigger ControlID="LinkButton2" EventName="Command" />
                    <asp:AsyncPostBackTrigger ControlID="LinkButton3" EventName="Command" />
                </Triggers>
            </asp:UpdatePanel>
        </td>
        <td class=tbBody_R></td>
    </tr>
    <tr>
        <td class=tbFoot_L></td>
        <td class=tbFoot_M></td>
        <td class=tbFoot_R></td>
    </tr>
</table>
</asp:Content>
